<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="description" content="Metro, a sleek, intuitive, and powerful framework for faster and easier web development for Windows Metro Style.">
    <meta name="keywords" content="HTML, CSS, JS, JavaScript, framework, metro, front-end, frontend, web development">
    <meta name="author" content="Sergey Pimenov and Metro UI CSS contributors">

    <link rel='shortcut icon' type='image/x-icon' href='favicon.ico' />
    <title>ProgressBar :: Metro UI CSS - The front-end framework for developing projects on the web in Windows Metro Style</title>

    <link href="css/metro.css" rel="stylesheet">
    <link href="css/metro-icons.css" rel="stylesheet">
    <link href="css/metro-responsive.css" rel="stylesheet">
    <link href="css/metro-schemes.css" rel="stylesheet">

    <link href="css/docs.css" rel="stylesheet">

    <script src="js/jquery-2.1.3.min.js"></script>
    <script src="js/metro.js"></script>
    <script src="js/docs.js"></script>
    <script src="js/prettify/run_prettify.js"></script>
    <script src="js/ga.js"></script>
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

</head>
<body>
    <div class="container page-content">
        <h1><a href="index.html" class="nav-button transform"><span></span></a>&nbsp;ProgressBar</h1>

        @@adsense

        <div class="example" data-text="example">
            <h5>Default</h5>
            <div class="progress" data-value="85" data-color="bg-red" data-role="progress"></div>

            <pre class="prettyprint linenums no-scroll-x"><code>
                &lt;div class="progress"
                    data-value="85"
                    data-color="bg-red"
                    data-role="progress"&gt;&lt;/div&gt;
            </code></pre>

            <h5>Small</h5>
            <div class="progress small" data-value="30" data-role="progress"></div>
            <pre class="prettyprint linenums no-scroll-x"><code>
                &lt;div class="progress small" data-role="progress"&gt;&lt;/div&gt;
            </code></pre>

            <h5>Large</h5>
            <div class="progress large" data-value="55" data-color="ribbed-amber" data-role="progress"></div>
            <pre class="prettyprint linenums no-scroll-x"><code>
                &lt;div class="progress large" data-role="progress"&gt;&lt;/div&gt;
            </code></pre>

            <h5>Gradient</h5>
            <div class="progress small gradient-bar" data-value="85" data-role="progress"></div>
            <pre class="prettyprint linenums no-scroll-x"><code>
                &lt;div class="progress gradient-bar" data-role="progress"&gt;&lt;/div&gt;
            </code></pre>

            <h5>Animate</h5>
            <div class="progress small" data-animate="500" data-value="85" data-role="progress"></div>
            <div class="progress large ani" data-value="55" data-color="ribbed-amber" data-role="progress"></div>

            <pre class="prettyprint linenums no-scroll-x"><code>
                &lt;div class="progress small" data-animate="500" data-role="progress"&gt;&lt;/div&gt;

                &lt;div class="progress ani" data-color="ribbed-amber" data-role="progress"&gt;&lt;/div&gt;
            </code></pre>
        </div>

        <div class="grid">
            <div class="row cells2">
                <div class="cell">
                    <div class="example" data-text="example">
                        <h5>Simple color test <span id="sct-1">0%</span></h5>
                        <div class="progress small" id="pb1" data-role="progress" data-value="0" data-color="bg-pink" data-on-progress="$('#sct-1').html(value+'%')"></div>

                        <button class="button success" onclick="runPB1()">Start</button>
                        <button class="button danger" onclick="stopPB1()">Stop</button>
                        <button class="button" onclick="flashPB1()">Reset</button>

                        <script>
                            var interval1;
                            function runPB1(){
                                clearInterval(interval1);
                                var pb = $("#pb1").data('progress');
                                var val = 0;
                                interval1 = setInterval(function(){
                                    val += 1;
                                    pb.set(val);
                                    if (val >= 100) {
                                        val = 0;
                                        clearInterval(interval1);
                                    }
                                }, 100);
                            }

                            function flashPB1(){
                                clearInterval(interval1);
                                var pb = $("#pb1").data('progress');
                                pb.set(0);
                            }

                            function stopPB1(){
                                clearInterval(interval1);
                            }
                        </script>
                    </div>
                </div>
                <div class="cell">
                    <div class="example" data-text="example">
                        <h5>Multi color test</h5>
                        <div class="progress small" id="pb2" data-parts="true" data-role="progress" data-value="0" data-colors='{"bg-red": 33, "bg-yellow": 66, "bg-cyan": 90, "bg-green": 100}'></div>

                        <button class="button success" onclick="runPB2()">Start</button>
                        <button class="button danger" onclick="stopPB2()">Stop</button>
                        <button class="button" onclick="flashPB2()">Reset</button>

                        <script>
                            var interval2;
                            function runPB2(){
                                clearInterval(interval2);
                                var pb = $("#pb2").data('progress');
                                var val = 0;
                                interval2 = setInterval(function(){
                                    val += 2;
                                    pb.set(val);
                                    if (val >= 100) {
                                        val = 0;
                                        clearInterval(interval2);
                                    }
                                }, 100);
                            }

                            function flashPB2(){
                                clearInterval(interval2);
                                var pb = $("#pb2").data('progress');
                                pb.set(0);
                            }

                            function stopPB2(){
                                clearInterval(interval2);
                            }
                        </script>
                    </div>
                </div>
            </div>
        </div>

        <div class="example" data-text="code">
            <pre class="prettyprint linenums no-scroll-x"><code>
                &lt;script&gt;
                    var interval1;
                    function runPB1(){
                        clearInterval(interval1);
                        var pb = $("#pb1").data('progress');
                        var val = 0;
                        interval1 = setInterval(function(){
                            val += 1;
                            pb.set(val);
                            if (val >= 100) {
                                val = 0;
                                clearInterval(interval1);
                            }
                        }, 100);
                    }

                    function flashPB1(){
                        clearInterval(interval1);
                        var pb = $("#pb1").data('progress');
                        pb.set(0);
                    }

                    function stopPB1(){
                        clearInterval(interval1);
                    }
                &lt;/script&gt;
            </code></pre>
        </div>
    </div>

    @@hit

</body>
</html>